﻿<%@ Page Language="C#" MasterPageFile="~/user/MasterPage.master" AutoEventWireup="true" CodeFile="message.aspx.cs" Inherits="user_message" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
        You have
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
&nbsp;messages.<br />
    </p>
    <p>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" CellPadding="4" DataKeyNames="no" 
            DataSourceID="LinqDataSource1" ForeColor="#333333" GridLines="None" Width="90%">
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" 
                            ImageUrl='<%# Eval("user.profile_picture","../user_imgs/1/{0}") %>' 
                            NavigateUrl='<%# Eval("create_user_no", "../user_profile.aspx?no={0}") %>'>[HyperLink2]</asp:HyperLink>
                    </ItemTemplate>
                    <ItemStyle Width="80px" />
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink1" runat="server" 
                            NavigateUrl='<%# Eval("create_user_no", "../user_profile.aspx?no={0}") %>' 
                            Text='<%# Eval("user.nickname") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="message" HeaderText="message" 
                    SortExpression="message" />
                <asp:BoundField DataField="addtime" HeaderText="addtime" 
                    SortExpression="addtime">
                    <ItemStyle Width="200px" />
                </asp:BoundField>
            </Columns>
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
    </p>
    <p>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
            ContextTypeName="ctpDataContext" EnableDelete="True" OrderBy="addtime desc" 
            TableName="user_msgs" Where="to_user_no == @to_user_no">
            <WhereParameters>
                <asp:SessionParameter Name="to_user_no" SessionField="userno" Type="Int32" />
            </WhereParameters>
        </asp:LinqDataSource>
    </p>
</asp:Content>

